<template>
    <div class="aa">


        <div class="left">

            <div class="menu" style="margin-left:20px;">
                <el-icon>
                    <HomeFilled />
                </el-icon>
                <span>/医院信息</span>



                <el-row class="tac">
                    <el-col :span="12">

                        <el-menu :default-active="$router.path" class="el-menu-vertical-demo" @open="handleOpen"
                            @close="handleClose">

                            <el-menu-item index="/detail/booking" @click="changeActive('/detail/booking')">
                                <el-icon><icon-menu /></el-icon>
                                <span>预约挂号</span>
                            </el-menu-item>
                            <el-menu-item index="/detail/hosDetail" @click="changeActive('/detail/hosDetail')">
                                <el-icon>
                                    <document />
                                </el-icon>
                                <span>医院详情</span>
                            </el-menu-item>
                            <el-menu-item index="/detail/knowing" @click="changeActive('/detail/knowing')">
                                <el-icon>
                                    <setting />
                                </el-icon>
                                <span>预约须知</span>
                            </el-menu-item>
                            <el-menu-item index="/detail/stoping" @click="changeActive('/detail/stoping')">
                                <el-icon>
                                    <setting />
                                </el-icon>
                                <span>停诊信息</span>
                            </el-menu-item>
                            <el-menu-item index="/detail/caling" @click="changeActive('/detail/caling')">
                                <el-icon>
                                    <WarningFilled />
                                </el-icon>
                                <span>查询/取消</span>
                            </el-menu-item>
                        </el-menu>
                    </el-col>

                </el-row>

            </div>
        </div>
        <div class="right">

            <router-view></router-view>
        </div>
    </div>
</template>
<script setup>
import { onMounted } from 'vue';
import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
    WarningFilled,
    HomeFilled
} from '@element-plus/icons-vue'

import { useRouter, useRoute } from 'vue-router';

import { requestHosDetail } from '@/api/Home.ts';

let routes = useRouter();

let $route = useRoute();
console.log(routes, $route);
function changeActive(path) {
    routes.push(path);

    console.log('aa', $route);

}

//  引入仓库文件
import defineUseDetail from '@/store/moudles/hosDetail.ts';

import useKes from '@/store/moudles/kes.ts';
let kesData1 = useKes();


//  使用仓库定义的定义，因为是方法
let defineUseDetail1 = defineUseDetail();


onMounted(() => {
    defineUseDetail1.getHos($route.query.code);
    kesData1.kesData();

})

console.log("打印前端传递的参数", $route.query);
</script>
<style scoped lang="scss">
.aa {
    display: flex;
    height: 90vh;
}

.left {
    flex: 2;


}

.right {
    flex: 8;
}
</style>
